from myelin.rdf.Ns import RDFS, OWL_NS, DAML_OIL_NS
from myelin.rdf.bindery.ObjectTypes import ResourceTypeO, LiteralTypeO

from VocabSchema import VocabSchema

from ObjectTypes import \
    PropertyTypeO, PropertyTypeS, \
    ClassTypeO

from mappings import \
    SchemaSetsMap, SchemaHierarchyMap, \
    SchemaRelationsMap


class Property(VocabSchema):
    
    ModelTypes = (PropertyTypeO, PropertyTypeS)
    
    RDF_BINDINGS = {
        'owlSameAs'         : ((OWL_NS, 'sameAs'), PropertyTypeO, SchemaSetsMap),
        'owlUnionOf'        : ((OWL_NS, 'unionOf'), PropertyTypeO, SchemaSetsMap),
        'owlDisjointWith'   : ((OWL_NS, 'disjointWith'), PropertyTypeO, SchemaSetsMap),
        'owlComplementOf'   : ((OWL_NS, 'complementOf'), PropertyTypeO, SchemaSetsMap),
        'owlInverseOf'      : ((OWL_NS, 'inverseOf'), PropertyTypeO, SchemaSetsMap),
        
        'damlUnionOf'        : ((DAML_OIL_NS, 'unionOf'), PropertyTypeO, SchemaSetsMap),
        'damlComplementOf'   : ((DAML_OIL_NS, 'complementOf'), PropertyTypeO, SchemaSetsMap),
        'damlSamePropertyAs' : ((DAML_OIL_NS, 'sameClassAs'), PropertyTypeO, SchemaSetsMap),        
    
        'rdfsDomain'         : ((RDFS, 'domain'), ClassTypeO, SchemaRelationsMap),
        'rdfsRange'          : ((RDFS, 'range'), ClassTypeO, SchemaRelationsMap),
        'rdfsSubPropertyOf'  : ((RDFS, 'subPropertyOf'), PropertyTypeO, SchemaHierarchyMap),                
    }

CLASS_TYPES = {
    RDFS + 'Property' : Property,
    OWL_NS + 'DataTypeProperty' : Property,
    OWL_NS + 'ObjectTypeProperty' : Property,
    OWL_NS + 'InverseFunctionalProperty' : Property,
    OWL_NS + 'FunctionalProperty' : Property,
}